<?php 
class User_addModel extends Model{
	// 定义表名
	public $table = 'f_user_add';

	// 自动验证
	public $validate = array(
		array('uaname','nonull','收件人不能为空',2,3),
		array('add','nonull','详细地址不能为空',2,3),
		array('telphone','nonull','手机号不能为空',2,3),
		array('telphone','phone','请填写正确的手机号',2,3)
		);

	// 添加地址
	public function add_data(){
		if (!$this->create()) {
			return false;
		}
		$add = Q('post.province').','.Q('post.city').','.Q('post.county').','.Q('post.add');
		$cell = Q('post.cellphone1').'-'.Q('post.cellphone2').'-'.Q('post.cellphone3');
		$this->data['address'] = $add;
		$this->data['cellphone'] = $cell;
		$this->data['f_user_uid'] = $_SESSION['uid'];
		return $this->add();

	}

}









 ?>